package org.jage.student.missevo.solution.reproduction;

import org.jage.agent.IAgentEnvironment;
import org.jage.platform.component.annotation.Inject;
import org.jage.property.ClassPropertyContainer;
import org.jage.property.IPropertiesSet;
import org.jage.property.PropertyField;

public class FixedEnergyRequiredToReproduce extends ClassPropertyContainer implements IShouldReproduce {
	
	@PropertyField(propertyName = "requiredEnergy")
	@Inject
	private double requiredEnergy;
	
	public boolean decide(IAgentEnvironment agentEnviroment, IPropertiesSet agentProperties) {
		return ((Double) agentProperties.getProperty("energy").getValue() >= requiredEnergy);
	}
	
}
